package com.HospitalOutpatient.dao;

import com.HospitalOutpatient.entity.Patient;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface PatientDao {

    @Select("select * from patient where userId = #{userId}")
    List<Patient> selectPatientByuserId(String userid);

    @Insert("insert into patient values (null,#{userId},#{patientName},#{idCard})")
    int addPatient(Patient patient);

    @Delete("delete from patient where patientId = #{patientId}")
    int deletePatient(String patientId);

    @Select("select  * from patient where patientId = #{patientId}")
    Patient selectPatientById(String patientId);
}
